 <?php                     
                            include_once'../classeBDD/connectBdd.php';
                            require 'Pager.php';
                            $sql = sql::connect();
                           $requery = $sql->query('SELECT * FROM annonce');
                             $nombre=$sql->num_rows($requery);
                             $requery = $sql->query("SELECT * FROM annonce where vous_etes='Professionnel'");
                             $nombre_prof=$sql->num_rows($requery);
                             $requery = $sql->query("SELECT * FROM annonce where vous_etes='Particulier'");
                             $nombre_part=$sql->num_rows($requery);
                             $requery = $sql->query("SELECT * FROM annonce where  type_annonce='Offres'");
                             $nombre_offres=$sql->num_rows($requery);
                          
                            ?>
<?php include_once"../formCRUD/regin_categori.php";?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!--link type="text/css" rel="stylesheet" href="/css/css.css"/-->
<script  type="text/javascript" src="/jquery/load.js"></script>
 <script type="text/javascript" src="/jquery/autocomplete-1.js"></script>
<script type="text/javascript">
window.onload = function(){initAutoComplete(document.getElementById('form-test'),
document.getElementById('champ-texte'),document.getElementById('bouton-submit'))};
</script>
</head>  

<body>
 <br/><br/><br/><br/>
    
 <div class="page_width">
       
		    <table width="100%" height="36" border="0" cellpadding="0" cellspacing="0">
                          <tr>
                            <td width="72%"  valign="middle" class="important_2">
                                <a href="./index.php?page_id=listertout">Toutes :<?php echo $nombre;?></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                <a href="./index.php?page_id=listerProff">Professionnel, <?php echo $nombre_prof;?></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                <a href="./index.php?page_id=listerparti">Particulier,  <?php echo $nombre_part;?></a></td>
                            <td width="28%" align="right" valign="middle"></td>
                          </tr>
                      </table>
					
        
        <br/><br/><br/>
        <div class="divmombre">
            <?php 
            echo '<ul>';
            $pager_options = array(
            'mode'       => 'Sliding',
            'perPage'    => 2,
            'delta'      => 1,
            'totalItems' =>  $nombre_offres,
            );
            $pager = Pager::factory($pager_options);
            list($from, $to) = $pager->getOffsetByPageId();
            $r=$from-1;  
            $req=$sql->query("SELECT * FROM annonce where type_annonce='Offres' ORDER  BY IdAnonce  LIMIT"." ".$r.", ".$pager_options['perPage']."");
            while( $resultat = $sql->fetch_array($req)){            
            echo '<ul  style="border-bottom:1px solid gray;">';
            echo "<a href='./lister_client.php?id_annonce='".$resultat['IdAnonce']."'><img style='border:0;vertical-align:top;text-align:left;margin-left:1px;' src='".$resultat['images']."' border='0' align='center' width='40%' height=30%/></a><br/>";
            echo $resultat['ttitre_annonce']."<br/>";
            echo $resultat['telephone']."<br/>";
            echo $resultat['prix']."<br/></ul>";
            }
            echo '</ul>';
            //show the links
            echo $pager->links;
            ?>

            
        </div>
       
       
        <br/><br/><br/><br/>
         </table>
    </div>
</body>
</html>

